package cn.yi.newsys.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

public class StringUtils {

	public static String getExt(String fileName){
		if(fileName != null && !"".equals(fileName)){
			int index = fileName.lastIndexOf(".") ;
			return fileName.substring(index) ;
		}
		return null ;
	}
	
	
	public static String getNewName(String fileName){
		String ext = getExt(fileName) ;
		SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss") ;
		return sdf.format(new Date()) + ext ;		
	}
}
